import Collapse from 'components/Markdown/Collapse'
import Warning from 'components/Markdown/Warning'

export const meta = {
  title: 'Prisma GraphQL API',
  position: 5
}

## Prisma GraphQL API

Prisma uses GraphQL as a _wire protocol_. This means a Prisma service exposes a GraphQL API with CRUD and realtime operations for the service's models. This GraphQL API is **not** directly consumed by your frontend/mobile applications, instead you're consuming it through the Prisma client inside your application (e.g. to implement a web server with a GraphQL or REST API). 

The GraphQL schema defining the types and operations of the Prisma GraphQL API is auto-generated based on the [datamodel](knul).

There are still some use cases where it can be appropriate to consume the Prisma GraphQL API directly:

- **Prototyping**: While you're still in the validation phase of an application, using the Prisma GraphQL API directly notably speeds up your development. When going into production, it's strognly recommended to use Prisma as the ORM-layer in your app and consume the Prisma GraphQL API through the Prisma client.
- **Internal tooling & public APIs**: If your API doesn't have any requirements for access permissions, no business logic is required, it might be a valid option to expose the Prisma GraphQL API directly to client applications.
- **Learning**: If you want to learn how GraphQL is consumed from the frontend (e.g. using Apollo Client), you can consume the Prisma GraphQL API directly without the need to add an additional web server layer on top.

### Reference

| Page | Description |
| --- | --- |
| [**Concepts**](vw4d) | Learn about the most important API concepts such as batching, Relay connections, transactions, cascading deletes, .. |
| [**Authentication**](ghd4) | Learn how to protect your Prisma API using the service secret |
| [**Queries**](qwe1) | Learn about the auto-generated queries in the Prisma API |
| [**Mutations**](qwe2) | Learn about the auto-generated mutations in the Prisma API |
| [**Subscriptions**](qwe3) | Learn about the auto-generated subscriptions in the Prisma API |
| [**Error Handling**](pdfv) | Learn how Prisma deals with errors in API requests |

### Usage

| Page | Description |
| --- | --- |
| [**Using the Prisma GraphQL API**](nms2) | Learn about various ways to consume the Prisma GraphQL API |

### Prisma Bindings

| Page | Description |
| --- | --- |
| [**Overview**](prb1) | Learn what Prisma bindings are and how they can be used to build GraphQL servers |
| [**Reference**](prb2) | API reference for Prisma bindings |
